<template>
	<view>
		<z-paging ref="paging" v-model="dataList" @query="queryList" loading-more-no-more-text="暂无更多">
			<empty-view slot="empty">
				<no-data customClass="bg-f5"></no-data>
			</empty-view>
			<view>
				<view class="u-p-r-28 u-p-l-28" v-for="(item,index) in dataList" :key="item.id">
					<post-card :item="item" @refresh="refresh"></post-card>
				</view>
			</view>
		</z-paging>
	</view>
</template>

<script>
	import {
		getPost
	} from '@/api/user';
	import postCard from '@/pagesMy/components/postCard/postCard.vue';
	import noData from '@/components/noData/noData.vue';
	export default {
		components: {
			postCard,
			noData
		},
		data() {
			return {
				dataList: [],
			}
		},

		methods: {
			refresh() {
				this.$refs.paging.reload();
			},
			async queryList(page, pageSize) {
				const postData = {
					page,
					pageSize,
				}
				const res = await getPost(postData);
				this.$refs.paging.complete(res.data.list);
			},
		}
	}
</script>
